using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MainGUI
{
    public partial class Form1 : Form
    {
        public Form1() {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e) {
            if (m_txtCar.Text.Length != 7) {
                MessageBox.Show("Error. Wrong license plate number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (m_IP.Text.Split(new char[] { '.' }).Length != 4) {
                MessageBox.Show("Error. Wrong IP.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            m_CarBox.Text = Program.CarInfo(m_txtCar.Text, m_IP.Text);
        }

        private void button2_Click(object sender, EventArgs e) {
            if (m_IP.Text.Split(new char[] { '.' }).Length != 4){
                MessageBox.Show("Error. Wrong IP.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            m_LotBox.Text = Program.PLotInfo(m_IP.Text);
        }
    }
}